function EmployeeTerritory(jsonObject) {
	this.internalObject = jsonObject;
}

EmployeeTerritory.prototype = {
	getEmployeeId: function() { return this.internalObject.EmployeeId; },
	getTerritoryId: function() { return this.internalObject.TerritoryId; },
	getCreatedDate: function() { return this.internalObject.CreatedDate; },
	getCreatedBy: function() { return this.internalObject.CreatedBy; },
	getModifiedDate: function() { return this.internalObject.ModifiedDate; },
	getModifiedBy: function() { return this.internalObject.ModifiedBy; },
	getEmployeeTerritoryObject: function() { return this.internalObject; }
};

function EmployeeTerritoryService() {
}

EmployeeTerritoryService.prototype.retrieveAll = function(successCallback) {
    viewServiceProxy.invokeGet("EmployeeTerritoryList", successCallback, OnPageError, true);
};

EmployeeTerritoryService.prototype.retrievePaged = function(successCallback, pageIndex, pageSize, sortOrder, sortColumn, linq) {
    var restUrl = "EmployeeTerritoryListPage";
    restUrl = restUrl + "/?";

    if (!IsNullOrEmpty(pageIndex)) {
        restUrl = restUrl + "pageIndex=" + pageIndex;
        if (!IsNullOrEmpty(pageSize) || !IsNullOrEmpty(sortOrder) || !IsNullOrEmpty(sortColumn) || !IsNullOrEmpty(linq)) {
            restUrl = restUrl + "&";
        }
    }
    if (!IsNullOrEmpty(pageSize)) {
        restUrl = restUrl + "pageSize=" + pageSize;
        if (!IsNullOrEmpty(sortOrder) || !IsNullOrEmpty(sortColumn) || !IsNullOrEmpty(linq)) {
            restUrl = restUrl + "&";
        }
    }
    if (!IsNullOrEmpty(sortOrder)) {
        restUrl = restUrl + "sortOrder=" + sortOrder;
        if (!IsNullOrEmpty(sortColumn) || !IsNullOrEmpty(linq)) {
            restUrl = restUrl + "&";
        }
    }
    if (!IsNullOrEmpty(sortColumn)) {
        restUrl = restUrl + "sortColumn=" + sortColumn;
        if (!IsNullOrEmpty(linq)) {
            restUrl = restUrl + "&";
        }
    }
    restUrl = restUrl + "linq=" + linq;

    viewServiceProxy.invokeGet(restUrl, successCallback, OnPageError, true);
};

EmployeeTerritoryService.prototype.save = function(employeeterritory, successCallback) {
viewServiceProxy.invokePut("EmployeeTerritory", employeeterritory.getEmployeeTerritoryObject(), successCallback, OnPageError, true);
};
